$" test.pingrepresents all minions that match start with M and end with com5, specify a discrete host match, you need to use the option -L, separated by commas minions#salt-L "master.test.com,minion.test.com" test.ping6. Custom groups to matchTo use a custom group for matching, you must define information about the group on the master side, and you must open the option on the master profile/etc/salt/master on the master side Default_include:master.d/*.confTo Edit a custom group configuration fi
remotely:Remote execution commands are probably the most common and convenient feature of ansible, here are a few examples1. Execute Minion Operating system commandsAnsible test-a ' W '-U sre-s #默认模块command, implementation of remote command,-a module parametersExecute script on Master on 2.minionMaster first creates the script 1.sh# !/bin/bash /tmp/' 1.sh ' -u sre-s #script module is equivalent to Scp+shell, local script is executed at remote minion3
the enabled state.1. Enable EPEL in RHEL
In your system, if the current EPEL is not in the enabled status, you can use the following command to enable it.For RHEL 5:
rpm -Uvh http://mirror.pnl.gov/epel/5/i386/epel-release-5-4.noarch.rpm
For RHEL 6:
rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8.noarch.rpm2. Install stable Edition
The master and minion packages of Salt are separated. The machine only needs to install the corresponding package to run. Generally, there will be
is if the master rejects the Minion end, Minion will automatically kill the service process, if there are 200 servers, all the Minion services are hung up, then work is big.Skills:The principle is: in Minion, master key and Minion can not conflict, if the conflict minion will kill themselves.Method:1, first prepare the new master key, the original master key directly packaged, the Salt directory under the PKI directory all packaged, and then uploaded to the new master. Before this new master do
: 10.10.100.60 masterclient1 end: 10.10.100.61 Client1client2 end: 10.10.100.62 Client22. Install Saltstack (hereinafter referred to as salt)1.> Installing the Epel Source:CentOS6 download Rpmwget-o epel.rpm http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm ( Installation of both server and client) RPM-UVH epel.rpm2.> Install Master (server side)Yum-y Install salt-master# When the installation is complete, the configuration file is/etc/salt/master3.> Install
Centralized management platform--saltstackSALTSTCK as a centralized management platform for server infrastructure, with configuration management, remote execution, monitoring and other functions. Can be simply understood as a simplified version of the Puppet, the enhanced version of Func. Don't say much nonsense, just get started.Saltstack Install and configure the components required for installationMain control: Salt-masterControlled End: Salt-minioninstallation process1, install the required
Tags: std host connection modify command close 5.5 hosts saysParamiko 1 ImportParamiko2
3Private_key = Paramiko. Rsakey.from_private_key_file ('/home/auto/.ssh/id_rsa')
4
5 #To create an SSH object
6SSH =Paramiko. Sshclient ()7 #allow connections to hosts that are not in the Know_hosts file
8 Ssh.set_missing_host_key_policy (Paramiko. Autoaddpolicy ())9 #connecting to a server
TenSsh.connect (hostname='c1.salt.com', Port=22, Username='Wupeiqi', key=Private_key) One
A #Execute Command
-st
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.